﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Truextend.CoffeShop.Service.Infrastructure;
using Truextend.CoffeShop.Model;
using Truextend.CoffeShop.Bussiness.Interfaces;
using Truextend.CoffeShop.Bussiness;

namespace Truextend.CoffeShop.Service
{
    public class DetailService : BaseService
    {
        public IList<Detail> GetAllDetailsOfAnOrder(int orderId)
        {
            IList<Detail> result = null;

            ExecuteManager(uow =>
                            {                                
                                IDetailManager manager = new DetailManager(uow,null);
                                result = manager.GetAllDetailsOfAnOrder(orderId);
                            });

            return result;
        }

        public void DeleteDetailOfAnOrder(int detailId)
        {
            ExecuteManager(uow =>             
                            {
                                IDetailManager manager = new DetailManager(uow, null);
                                manager.DeleteDetail(detailId);
                            });

        }
    }
}
